<template>
  <div>
    {{ data1 }}
    <CustomTreeselect
      :options="dataList"
      v-model="data1"
      :defaultExpandLevel="Infinity"
      openDirection="auto"
      :clearable="false"
      :maxHeight="200"
      :zIndex="2999"
      @select="selectNode"
      placeholder="请选择"
      noResultsText="没有数据"
      searchPromptText="请输入关键字搜索"
      :multiple="false"
    />
  </div>
</template>

<script>
// import CustomTreeselect from './CustomTreeselect.vue';
export default {
  data() {
    return {
      data1: null,
      dataList: [
        {
          id: '1',
          label: 'XX集团1',
          children: [
            {
              id: '2019112814172680887',
              label: '数字化物产云大数据平台',
              children: [
                {
                  id: '2019121908462138134',
                  label: '主数据管理',
                  children: [
                    {
                      id: '2019121908510205183',
                      label: '合作伙伴主数据',
                    },
                    {
                      id: '2019121908512359836',
                      label: '供应链主体主数据',
                    },
                    {
                      id: '2019121908513394033',
                      label: '银行主数据维护',
                    },
                    {
                      id: '2019121908514289360',
                      label: '财务科目主数据维护',
                      index: '/masterData/financeAccount',
                    },
                  ],
                },
                {
                  id: '2019112817570532626',
                  label: '采购销售中心',
                  index: '',
                  children: [
                    {
                      id: '2019121909064355718',
                      label: '销售管理',
                      index: '',
                      children: [
                        {
                          id: '2019121909182218402',
                          label: '销售合同',
                          index: '/salePurchase/saleOverview',
                        },
                        {
                          id: '2019121909194117930',
                          label: '销售提单',
                          index: '/salePurchase/salesLadingbill',
                        },
                      ],
                    },
                    {
                      id: '2023020620251880466',
                      label: '服务合同',
                      index: '/salePurchase/serviceContractList',
                    },
                    {
                      id: '2019121909065960582',
                      label: '采购管理',
                      index: '',
                      children: [
                        {
                          id: '2019121909201165765',
                          label: '采购合同',
                          index: '/salePurchase/purchaseOverview',
                        },
                      ],
                    },
                  ],
                },
              ],
            },
          ],
        },
        {
          id: '2',
          label: '测试',
          children: [],
        },
      ],
    };
  },
  methods: {
    selectNode(val) {
      console.log(val, '选择节点');
    },
  },
  components: {},
};
</script>

<style></style>
